@echo off

setlocal DISABLEDELAYEDEXPANSION

call "%%CONTOOLS_ROOT%%/std/get_cmdline_var_len.bat" %%FLAGS%% CMDLINE
set ARGS_COUNT=%ERRORLEVEL%

if %TESTLIB__OVERALL_TESTS% GTR %TESTLIB__CURRENT_TESTS% (
  set "TEST_REPORT_PREFIX_STR=%TESTLIB__OVERALL_TESTS%`%TESTLIB__CURRENT_TESTS%"
) else set "TEST_REPORT_PREFIX_STR=%TESTLIB__CURRENT_TESTS%"

if defined CMDLINE (
  set $CMDLINE=${CMDLINE}
) else set "$CMDLINE="

"%CONTOOLS_UTILITIES_BIN_ROOT%/contools/envvarcmp.exe" ARGS_COUNT ARGS_COUNT_REFERENCE "" ^
  "PASSED: %TEST_REPORT_PREFIX_STR%: RESULT=`{0}` CMDLINE=`%$CMDLINE%`" ^
  "FAILED: %TEST_REPORT_PREFIX_STR%: RESULT=`{0}` REFERENCE=`{1}` CMDLINE=`%$CMDLINE%`"
if %ERRORLEVEL% NEQ 0 (
  exit /b 1
)

exit /b 0
